package com.stefan.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class RedisOpsUtil {
    @Autowired
    private RedisTemplate redisTemplate;

    public <T> T get(String key,Class<T> clazz) {
        return  (T) redisTemplate.opsForValue().get(key);
    }
    public void set(String key,Object value){
        redisTemplate.opsForValue().set(key,value);
    }
}
